package com.ruoyi.web.utils;

import cn.hutool.http.Header;
import cn.hutool.http.HttpRequest;

public  class  Httpapi {
    String url = "https://agentseller.temu.com/api/seller/auth/userInfo";
    String cookie = "api_uid=Cmw0XGh4jKNitwBV/bp1Ag==; _bee=N8ubKPJKXnQ4C4RCx6P3Ff5fGHUvuanw; njrpl=N8ubKPJKXnQ4C4RCx6P3Ff5fGHUvuanw; dilx=mY2w0CCn2dfEpYU2sLJz7; hfsc=L3yOf4026T381ZLKcQ==; _nano_fp=XpmyX5mqX0UaXqTynT_YUfQ_87BY~DNnJttdZ0xN; x-hng=lang=zh-CN&domain=agentseller.temu.com; mallid=634418221988750; gmp_temu_token=MAeNPIY9KjcOlqTG01/C3eX9sx61XOfKhSxT22AMreWI5BZa6zVROxsUCOAh5Yws3yGvHU2y/gijyAC+x7OuFYmQ8Sr8S713sHF6hLmLB+i6Hzaz3kjaZXZxrwL/ZEUr+dp8OK1cPjyqab5XtkJiK8X8BBrklWV8e2iTDCRZxYI; seller_temp=N_eyJ0IjoidGhXNTRxSDRBc0VqODV2NmhGcFJSdGRUMDc0aWdXWXFiVEYvN2hFTmt2dGo4M0RjWllZRFE5ZUI3NHhDUmN3Ukh3RTZCZlV2Q0o4RzRYdGJjck9MOWc9PSIsInYiOjEsInMiOjEwMDAxLCJ1IjoyMzgzOTAyNjg5MTc0Nn0=";

    public static String post(String url, String cookie,String body,String mallid) {
        String resp = HttpRequest.post(url)
                .header(Header.COOKIE, cookie)//头信息，多个头信息多次调用此方法即可
                .header("mallid", mallid)//头信息，多个头信息多次调用此方法即可
                .body(body)//表单内容
                .timeout(20000)//超时，毫秒
                .execute().body();
        return resp;
    }

    public static String post(String url, String cookie,String body ) {
                String resp = HttpRequest.post(url)
                .header(Header.COOKIE, cookie)//头信息，多个头信息多次调用此方法即可
                .body(body)//表单内容
                .timeout(20000)//超时，毫秒
                .execute().body();
        return resp;
    }
}
